import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class TestXml {

	public static void main (String[] args){
	
		
		try {
			Document document = parse("C:\\Users\\Nissim\\s3\\workspace\\springapp\\war\\WEB-INF\\jsp\\todo.jsp");
			for(Iterator<Node> it =document.getRootElement().nodeIterator(); it.hasNext();){
				//			for(Node n : document.getRootElement().elements("bean")){


				System.out.println(it.toString());

			}

			System.out.println();
		} catch (DocumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public static Document parse(String path) throws DocumentException {
		File f = new File(path);
		SAXReader reader = new SAXReader();
		Document document = reader.read(f);
		return document;
	}
}